#define  _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
double arr[100][2] = { 0 };
int f = 0;
typedef struct point
{
	double x1, x2, y2, y1;
	double length;
	struct point* next;
}point;
void push(double qx1, double qy1, double qx2, double qy2, point* head)
{
	while (head->next)
	{
		head = head->next;
	}
	point* p = (point*)malloc(sizeof(point));
	head->next = p;

	p->x1 = qx1;
	p->x2 = qx2;
	p->y1 = qy1;
	p->y2 = qy2;
	double m = qx1 - qx2;
	double n = qy1 - qy2;
	p->length = sqrt(m * m + n * n);
	p->next = NULL;
	arr[f][0] = p->length;
	arr[f][1] = p->x1;
	f++;
}
int main()
{

	int n = 0;
	scanf("%d", &n);
	int i = n;
	point* phead = (point*)malloc(sizeof(point));
	phead->next = NULL;
	while (i--)
	{
		double x1, x2, y2, y1;
		scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
		push(x1, y1, x2, y2, phead);

	}
	int j = 0;
	for (i = 0; i < n - 1; i++)
	{
		for (j = 0; j < n - i - 1; j++)
		{
			if ((arr[j][0] > arr[j + 1][0])||(arr[j][0] == arr[j + 1][0])&&(arr[j][1]>arr[j+1][1]))
			{
				double tmp = arr[j][0];
				double tmp1 = arr[j][1];
				arr[j][0] = arr[j + 1][0];
				arr[j][1] = arr[j + 1][1];
				arr[j + 1][0] = tmp;
				arr[j + 1][1] = tmp1;
			}
			
		}
	}

	for (i = 0; i < n; i++)
	{
		point* head = phead;
		while (head)
		{
			head = head->next;
			if ((head && (head->length) == arr[i][0])&&(head->x1==arr[i][1]))
			{
				printf("(%.1f,%.1f)(%.1f,%.1f),%.1f", head->x1, head->y1, head->x2, head->y2, head->length);
				head->length = 0;
				printf("\n");
				break;
			}
		}
	}
	return 0;
}
